package com.wrupple.muba.catalogs.client.widgets.fields.providers;

import java.util.Date;

import com.google.gwt.cell.client.Cell;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.cell.client.DatePickerCell;
import com.google.gwt.event.shared.EventBus;
import com.wrupple.muba.catalogs.client.activity.process.task.CatalogInteractionState.Mode;
import com.wrupple.muba.catalogs.client.module.services.presentation.CatalogFormFieldProvider;
import com.wrupple.muba.common.shared.State.ProcessManager;
import com.wrupple.vegetate.domain.FieldDescriptor;

public class DateFieldProvider implements CatalogFormFieldProvider {

	@Override
	public Cell<Date> createCell(EventBus bus, ProcessManager pm, FieldDescriptor d, Mode mode)  {
		Cell<Date> wrapped = null;
		if (mode== Mode.READ) {
			wrapped = new DateCell();
		} else {
			wrapped = new DatePickerCell();
			
		}
		return wrapped;
	}

}
